package cn.ycc1.feign.clients;

import cn.ycc1.feign.clients.fallback.UserClientFallbackFactory;
import cn.ycc1.feign.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Title:
 * @Author ycc
 * @Date 2023/7/8 21:20
 */
@FeignClient(value = "user-service", fallbackFactory = UserClientFallbackFactory.class)
public interface UserClient {
    @GetMapping("/user/findByUsername/{username}")
    User findByUsername(@PathVariable("username") String username);

    @GetMapping("/user/findByUserId/{userId}")
    User findByUserId(@PathVariable("userId") String userId);
}
